import { Component, OnInit } from '@angular/core';
import { AutoUnsubscribe } from 'ngx-auto-unsubscribe-decorator';
import { Store } from '@ngxs/store';
import { SystemAction, SystemSelector } from '../../store';

@Component({
  selector: 'app-welcome',
  templateUrl: './welcome.component.html',
  styleUrls: ['./welcome.component.scss'],
})
export class WelcomeComponent implements OnInit {
  @AutoUnsubscribe() tempData$ = this.store.select(SystemSelector.tempData);
  testParam = '';

  constructor(
      private store: Store,
  ) {
  }

  ngOnInit() {
  }

  test() {
    console.log('test');
    this.store.dispatch(new SystemAction.SaveTempData(this.testParam));
  }
}
